package com.zxh.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Date;

import com.zxh.utils.DBUtils;

public class CompanyDao {
	public void save(String company_name,String company_area,String company_size,String company_type,String company_brief){
		Connection con =null;
		PreparedStatement ps =null;
		ResultSet rs = null;
		String sql ="insert into company(company_name,company_area,company_size,company_type,company_brief) values(?,?,?,?,?)";
		try {
			 con= DBUtils.getConnection();//获取数据库连接
			 ps = con.prepareStatement(sql);//执行预编译的sql语句
			 ps.setString(1, company_name);//设置参数
			 ps.setString(2,company_area);
			 ps.setString(3,company_size);
			 ps.setString(4,company_type);
			 ps.setString(5,company_brief);
			 ps.executeUpdate();//执行更新操作
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally{
			DBUtils.close(con, rs, null, ps);
		}//获取数据库连接
	}
}
